<?
if(isset($_POST['salir']))
	{
	echo '
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
	<title>Autos y Refacciones</title>
	<meta http-equiv="Content-Type"  content="text/html; charset=UTF-8"/>
	<SCRIPT language="Javascript" type="text/javascript">parent.document.location="perfil.php?idperfil='.$_POST['idperfil'].'&subsection=autos";</script>
	</head>
	<body>
	</body>
	</html>';
	}


$idauto = $_REQUEST['idauto'];
require('abrirdb.php');
$sql = mysql_query("SELECT * FROM perfil_auto WHERE id_perfilauto = '$idauto'");
$array = mysql_fetch_array($sql);
$idcliente = $array['id_cliente'];
require('abrirdb.php');
$sql2 = mysql_query("select * from perfil_global where id_cliente = '$idcliente'");
$array2 = mysql_fetch_array($sql2);
$text = '<ul id="thumb_holder">
	<li><a href="javascript:void(0);"><img src="autos/'.$array['imagen'].'" width="45" height="45" /></a></li>';
require('abrirdb.php');
$sql3 = mysql_query("SELECT * FROM galeria_auto WHERE id_perfilauto = '$idauto'");
while($array3 = mysql_fetch_array($sql3))
	{ $text .= '
	<li><a href="javascript:void(0);"><img src="galeria_auto/'.$array3['imagen'].'" width="45" height="45" /></a></li>'; }
$text .= '</ul>';
$text2 = '<ul id="large_images">
<li><img src="autos/'.$array['imagen'].'" width="400" height="300" /></li>';
require('abrirdb.php');
$sql4 = mysql_query("SELECT * FROM galeria_auto WHERE id_perfilauto = '$idauto'");
while($array4 = mysql_fetch_array($sql4))
	{ $text2 .= '
	<li><img src="galeria_auto/'.$array4['imagen'].'" width="400" height="300" /></li>'; }
$text2 .= '</ul>';


require('abrirdb.php');
$sql_info = mysql_query("select * from perfil_informacion where id_cliente = '$idcliente'");
$perfil_info = mysql_fetch_array($sql_info);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Autos Y Refacciones</title>
<script type="text/javascript" src="js/jquery-1.2.6.js"></script>
<link rel="stylesheet" type="text/css" href="js/jqgal/style22.css" media="screen" />
<script src="js/jqgal/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/jqgal/simple_thumbs.js" type="text/javascript"></script>
<style type="text/css">
<!--
.red16		{ font-family: Helvetica; font-size: 16px; color: #FF0000}
.gray12		{ font-family: Helvetica; font-size: 12px; color: #666666}
.black12	{ font-family: Helvetica; font-size: 12px; color: #000000}
.black16	{ font-family: Helvetica; font-size: 16px; color: #000000}
.style1 {font-family: Helvetica; font-size: 16px; color: #000000; font-weight: bold; }
-->
</style>
</head>
<body>
<form action="" method="post">
<table width="550" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr><td colspan="2" align="center" class="black12"><strong>Anunciantes:</strong> <a href="perfil.php?idperfil=5">Suzuki Las Torres</a> - <a href="contactanos.php">Disponible</a> - <a href="contactanos.php">Disponible</a></td></tr>
	<tr><td colspan="2" align="left" class="style1">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr><td width="72%"><?=$array['marca'];?> <?=$array['modelo'];?> <?=$array['anio'];?></td>
				<td width="28%"><span class="red16"><strong>$<?=number_format($array['precio'],2,'.',',');?>MXN</strong></span></td></tr>
		</table></td></tr>
	<tr><td colspan="2" align="left" class="gray12">Transmision: <span class="black12"><?=$array['transmision'];?></span></td></tr>
	<tr><td width="472" height="300"><?=$text2;?></td><td width="78"><span style="text-align:center;"><?=$text;?></span></td></tr>
    <tr><td colspan="2" style="text-align:center;">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr><td colspan="2" class="gray12">&nbsp;</td></tr>
			<tr><td class="gray12">Datos de contacto</td><td class="gray12">Ubicación</td></tr>
			<tr><td class="black12"><?=$perfil_info['telefonos'];?></td>
        		<td class="black12"><?=$perfil_info['ubicacion'];?></td></tr>
      		<tr><td height="20" colspan="2" class="gray12" style="vertical-align:bottom">Comentarios Adicionales</td></tr>
      		<tr><td colspan="2" class="black12"><?=$perfil_info['noticias'];?></td></tr>
		</table></td></tr>
</table>
</form>
</body>
</html>